import { createBrowserRouter, Navigate } from 'react-router-dom'
import Home from '../pages/home/Index'
import Index from '../pages/index/Index'
import List from '../pages/list/Index'
import Order from '../pages/order/Index'
import Oo from '../pages/order/oo/Index'
import Rr from '../pages/order/rr/Index'
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';

export const homerouters = [
    {
        path: '/home/index',
        element: <Index />,
        title: '首页',
        icon:<DesktopOutlined/>
    },
    {
        path: '/home/list',
        element: <List />,
        title: '文档',
        icon:<FileOutlined/>
    },
    {
        path: '/home/order',
        element: <Order />,
        title: '系统管理',
        icon:<PieChartOutlined/>,
        children: [
            {
                path: '/home/order/oo',
                element: <Oo />,
                title: '用户管理',
                icon:<TeamOutlined/>,
            },
            {
                path: '/home/order/rr',
                element: <Rr />,
                title: '角色管理',
                icon:<UserOutlined/>,
            }
        ]
    }
]
const router = createBrowserRouter([
    {
        path: '/',
        element: <Navigate to={'/home'}></Navigate>
    },
    {
        path: '/home',
        element: <Home />,
        children: homerouters

    }
])
export default router